{template '_header'}
<div class="page-heading"> 
	<span class='pull-right'>
		{ifp 'merch.category.swipe.add'}
			<a class="btn btn-primary btn-sm" href="{php echo webUrl('merch/category/add_swipe')}">添加新商户分类幻灯</a>
		{/if}
		<a class="btn btn-default  btn-sm" href="{php echo webUrl('merch/category/swipe')}">返回列表</a>
	</span>
	<h2>{if !empty($item['id'])}编辑{else}添加{/if}商户分组 <small>{if !empty($item['id'])}修改【{$item['groupname']}】{/if}</small></h2>
</div>

<form {ife 'merch.group' $item}action="" method="post"{/if} class="form-horizontal form-validate" enctype="multipart/form-data">
<input type="hidden" name="id" value="{$item['id']}" />

<div class="form-group">
	<label class="col-sm-2 control-label">排序</label>
	<div class="col-sm-9 col-xs-12">
		{ife 'merch.category.swipe' $item}
		<input type="text" name="displayorder" id="displayorder" class="form-control" value="{$item['displayorder']}" />
		<span class='help-block'>数字越大，排名越靠前,如果为空，默认排序方式为创建时间</span>
		{else}
		<div class='form-control-static'>{$item['displayorder']}</div>
		{/if}
	</div>
</div>

 <div class="form-group">
	<label class="col-sm-2 control-label must">幻灯名称</label>
	<div class="col-sm-9 col-xs-12 ">
		{ife 'merch.category.swipe' $item}
		<input type="text" name="title" class="form-control" value="{$item['title']}" data-rule-required="true" />
		{else}
		<div class='form-control-static'>{$item['title']}</div>
		{/if}
	</div>
</div>

<div class="form-group">
	<label class="col-sm-2 control-label">幻灯图片</label>
	<div class="col-sm-9 col-xs-12">
		{ife 'merch.category.swipe' $item}
		{php echo tpl_form_field_image('thumb', $item['thumb'])}
		<span class="help-block">建议尺寸: 640*360 尺寸图片 </span>
		{else}
		{if !empty($item['thumb'])}
		<a href='{php echo tomedia($item['thumb'])}' target='_blank'>
		<img src="{php echo tomedia($item['thumb'])}" style='width:100px;border:1px solid #ccc;padding:1px' />
		</a>
		{/if}
		{/if}
	</div>
</div>

<div class="form-group">
	<label class="col-sm-2 control-label">是否显示</label>
	<div class="col-sm-9 col-xs-12">
		{ife 'merch.category.swipe' $item}
		<label class='radio-inline'>
			<input type='radio' name='status' value='1' {if $item['status']==1}checked{/if} /> 是
		</label>
		<label class='radio-inline'>
			<input type='radio' name='status' value='0' {if empty($item['status'])}checked{/if} /> 否
		</label>
		{else}
		<div class='form-control-static'>{if empty($item['status'])}否{else}是{/if}</div>
		{/if}
	</div>
</div>

<div class="form-group">
	<label class="col-sm-2 control-label"></label>
	<div class="col-sm-9 col-xs-12">
		{ife 'merch.category.swipe' $item}
		<input type="submit" value="提交" class="btn btn-primary"  />
		{/if}
		<input type="button" name="back" onclick='history.back()' {ifp 'merch.category.swipe.add|merch.category.swipe.edit'}style='margin-left:10px;'{/if} value="返回列表" class="btn btn-default" />
	</div>
</div>

</form>
{template '_footer'}